package android.poi;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * SYNC with: vendor/cns_gateway_utils/aidl/android/poi/parcelable_home_location.cpp
 *
 */
public class ParcelableHomeLocation implements Parcelable {
    
    public double mLongitude = 0;
    public double mLatitude = 0;
    public String mHomeName;
    
    public ParcelableHomeLocation() {}
    
    public ParcelableHomeLocation(double longitude, double latitude, String homeName) {
        mLongitude = longitude;
        mLatitude = latitude;
        mHomeName = homeName;
    }
    
    public int describeContents() { return 0; }
    
    
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeDouble(mLongitude);
        dest.writeDouble(mLatitude);
        dest.writeString(mHomeName);
    }
    
    public void readFromParcel(Parcel source) {
        mLongitude = source.readDouble();
        mLatitude = source.readDouble();
        mHomeName = source.readString();
    }
    
    public String toString() {
        return "ParcelableHomeLocation(" + mLongitude + ", " + mLatitude + ", " + mHomeName + ")";
    }
    
    public static final Parcelable.Creator<ParcelableHomeLocation> CREATOR =
            new Parcelable.Creator<ParcelableHomeLocation>() {
        public ParcelableHomeLocation createFromParcel(Parcel source) {
            double longitude = source.readDouble();
            double latitude = source.readDouble();
            String homeName = source.readString();
            return new ParcelableHomeLocation(longitude, latitude, homeName);
        }

        public ParcelableHomeLocation[] newArray(int size) {
            return new ParcelableHomeLocation[size];
        }
    };

}
